<template>
  <h1> 事件绑定指令</h1>
  <button @click="f">按钮1</button> |
  <button v-on:click="f">按钮1</button>
  <input type="text" placeholder="搜索" v-model="search" @keydown.enter="ent">
</template>

<script setup>
import {ref} from "vue";

const f=()=>{
  alert('点击了');
}
const search=ref('');
const ent=()=>{
  alert('您搜索的是'+search.value+'吗?');
  console.log(search);
  console.log();
}
</script>


<style scoped>

</style>